package com.itheima.demoString;

import java.util.Scanner;

public class Demo04String {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符窜:");
        String str = sc.next();
        int count = 0;
        char[] chs = str.toCharArray();
        for (int i = 0; i < chs.length; i++) {
            System.out.println(chs[i]);
            count++;
        }
        System.out.println("----------");
        for (int i = 0; i < str.length(); i++) {
            System.out.println(str.charAt(i));
        }
        System.out.println("字符串长度为:" + count);
    }
}
